# -*- coding: utf-8 -*-
import cx_Oracle as db


def queryOracle(sql):
    username = "mfund_new"      #用户名
    passwd = "mfund"          #用户密码
    host = "10.1.1.221"     #服务器IP
    port = "1521"              #oracle端口
    sid = "ORCL"               #oracle的
    dsn = db.makedsn(host, port, sid)
    con = db.connect(username, passwd, dsn)
    cur = con.cursor()
    cur.execute(sql)
    result = cur.fetchall()
    cur.close()
    con.close()
    return result


if __name__ == "__main__":
    sql = "select * from f_fund_base_info"    #需要执行的SQL
    result = queryOracle(sql)
    print(result)